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) {
267
267
p . endCopyFrom = function ( ) {
268
268
this . stream . write ( this . writer . add ( emptyBuffer ) . flush ( 0x63 ) ) ;
269
269
}
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
+ }
270
275
//parsing methods
271
276
p . setBuffer = function ( buffer ) {
272
277
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) {
171
171
} ;
172
172
p . streamData = function ( connection ) {
173
173
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' ) ;
179
175
} ;
180
176
p . handleCopyFromChunk = function ( chunk ) {
181
177
if ( this . stream ) this . stream . handleChunk ( chunk ) ;
You can’t perform that action at this time.
0 commit comments