-static int raw_receive (Socket s, int urgent, char *data, int len) {
- if (!len) {
- /* Connection has closed. */
- sk_close(s);
- s = NULL;
- return 0;
- }
+static int raw_closing (Plug plug, char *error_msg, int error_code, int calling_back) {
+ sk_close(s);
+ s = NULL;
+ if (error_msg) {
+ /* A socket error has occurred. */
+ connection_fatal (error_msg);
+ } /* Otherwise, the remote side closed the connection normally. */
+ return 0;
+}
+
+static int raw_receive (Plug plug, int urgent, char *data, int len) {