Skip to content
Snippets Groups Projects
Commit f5c4e6d5 authored by rswindell's avatar rswindell
Browse files

Bug-fix: Socket.sendfile() would leave file open (as of 2 years 8 months ago!).

parent 5dcc5821
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -526,6 +526,7 @@ js_sendfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
free(buf);
#else
len = sendfilesocket(p->sock, file, NULL, 0);
close(file);
if(len > 0) {
dbprintf(FALSE, p, "sent %u bytes",len);
*rval = JSVAL_TRUE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment