File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -267,6 +267,11 @@ p.sendCopyFromChunk = function (chunk) {
267267p . endCopyFrom = function ( ) {
268268 this . stream . write ( this . writer . add ( emptyBuffer ) . flush ( 0x63 ) ) ;
269269}
270+ p . sendCopyFail = function ( msg ) {
271+ //this.stream.write(this.writer.add(emptyBuffer).flush(0x66));
272+ this . writer . addCString ( msg ) ;
273+ this . _send ( 0x66 ) ;
274+ }
270275//parsing methods
271276p . setBuffer = function ( buffer ) {
272277 if ( this . lastBuffer ) { //we have unfinished biznaz
Original file line number Diff line number Diff line change @@ -171,11 +171,7 @@ p.prepare = function(connection) {
171171} ;
172172p . streamData = function ( connection ) {
173173 if ( this . stream ) this . stream . startStreamingToConnection ( connection ) ;
174- else {
175- connection . endCopyFrom ( ) ; // send an EOF to connection
176- // TODO: signal the problem somehow
177- //this.handleError(new Error('No source stream defined'));
178- }
174+ else connection . sendCopyFail ( 'No source stream defined' ) ;
179175} ;
180176p . handleCopyFromChunk = function ( chunk ) {
181177 if ( this . stream ) this . stream . handleChunk ( chunk ) ;
You can’t perform that action at this time.
0 commit comments