-static int raw_receive (Socket skt, int urgent, char *data, int len) {
- if (urgent==3) {
- /* A socket error has occurred. */
- s = NULL;
- connection_fatal(data);
- len = 0;
- }
- 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)
+{