Browse Source

don't die on EPIPE

v0.7.4-release
Ryan 16 years ago
parent
commit
43531093a3
  1. 4
      deps/liboi/oi_socket.c
  2. 7
      src/file.js
  3. 2
      src/net.h

4
deps/liboi/oi_socket.c

@ -472,6 +472,10 @@ socket_send (oi_socket *socket)
socket->errorno = errno; socket->errorno = errno;
return ERROR; return ERROR;
case EPIPE:
socket->errorno = errno;
return ERROR;
default: default:
perror("send()"); perror("send()");
printf("%p had send error\n", socket); printf("%p had send error\n", socket);

7
src/file.js

@ -13,9 +13,12 @@ File.exists = function (path, callback) {
} }
File.cat = function (path, encoding, callback) { File.cat = function (path, encoding, callback) {
var content = "";
var file = new File(); var file = new File();
file.encoding = "utf8"; file.encoding = encoding;
var content = "";
if (file.encoding == "raw") content = [];
var pos = 0; var pos = 0;
var chunkSize = 10*1024; var chunkSize = 10*1024;

2
src/net.h

@ -70,8 +70,10 @@ private:
Connection *connection = static_cast<Connection*> (s->data); Connection *connection = static_cast<Connection*> (s->data);
connection->OnDisconnect(); connection->OnDisconnect();
/*
if (s->errorno) if (s->errorno)
printf("socket died with error %d\n", s->errorno); printf("socket died with error %d\n", s->errorno);
*/
connection->Detach(); connection->Detach();
} }

Loading…
Cancel
Save