1 --- sane-backends-1.0.8/sanei/sanei_wire.c.saned 2002-03-21 00:17:06.000000000 +0000
2 +++ sane-backends-1.0.8/sanei/sanei_wire.c 2003-09-11 12:31:30.000000000 +0100
5 DBG (4, "sanei_w_array: send/receive array length\n");
6 sanei_w_word (w, &len);
7 - DBG (4, "sanei_w_array: array has %d elements\n", len);
11 + DBG (1, "sanei_w_array: bad status: %d\n", w->status);
14 + DBG (4, "sanei_w_array: array has %d elements\n", len);
16 if (w->direction == WIRE_DECODE)
21 (*w_element) (w, val);
25 + DBG (1, "sanei_w_array: bad status: %d\n", w->status);
29 DBG (4, "sanei_w_array: done\n");
33 DBG (4, "sanei_w_ptr: send/receive is_null\n");
34 sanei_w_word (w, &is_null);
37 + DBG (1, "sanei_w_ptr: bad status: %d\n", w->status);
45 DBG (3, "sanei_w_string: wire %d\n", w->io.fd);
46 (*w->codec.w_string) (w, v);
47 - if (w->direction != WIRE_FREE)
48 + if (w->direction != WIRE_FREE && w->status == 0)
49 DBG (4, "sanei_w_string: value = %s\n", *v);
52 --- sane-backends-1.0.8/sanei/sanei_codec_bin.c.saned 2001-05-14 22:55:52.000000000 +0100
53 +++ sane-backends-1.0.8/sanei/sanei_codec_bin.c 2003-09-11 12:31:30.000000000 +0100
65 len = strlen (*s) + 1;
67 sanei_w_array (w, &len, v, w->codec.w_byte, 1);
68 - if (w->direction == WIRE_DECODE && !len)
71 + if (w->direction == WIRE_DECODE)
75 + else if (w->status == 0)
76 + *(*s + len - 1) = '\0';
82 SANE_Word val, *word = v;
90 --- sane-backends-1.0.8/frontend/saned.c.saned 2002-02-16 18:10:26.000000000 +0000
91 +++ sane-backends-1.0.8/frontend/saned.c 2003-09-11 12:31:30.000000000 +0100
98 + DBG(DBG_ERR, "auth_callback: bad status %d\n", wire.status);
102 switch (current_request)
105 @@ -222,10 +228,24 @@
106 current_request, res);
112 + DBG(DBG_ERR, "auth_callback: bad status %d\n", wire.status);
118 sanei_w_set_dir (&wire, WIRE_DECODE);
119 sanei_w_word (&wire, &word);
123 + DBG(DBG_ERR, "auth_callback: bad status %d\n", wire.status);
128 if (procnum != SANE_NET_AUTHORIZE)
133 sanei_w_authorization_req (&wire, &req);
136 + DBG(DBG_ERR, "auth_callback: bad status %d\n", wire.status);
141 strcpy (username, req.username);
143 @@ -514,30 +540,51 @@
147 + status = check_host (w->io.fd);
148 + if (status != SANE_STATUS_GOOD)
150 + DBG (DBG_WARN, "init: access by host %s denied\n", remote_hostname);
154 sanei_w_set_dir (w, WIRE_DECODE);
157 + DBG (DBG_ERR, "init: bad status after sanei_w_set_dir: %d\n", w->status);
161 sanei_w_word (w, &word); /* decode procedure number */
162 - sanei_w_init_req (w, &req);
163 - w->version = SANEI_NET_PROTOCOL_VERSION;
165 if (w->status || word != SANE_NET_INIT)
167 DBG (DBG_ERR, "init: bad status=%d or procnum=%d\n",
172 + sanei_w_init_req (w, &req);
175 + DBG (DBG_ERR, "init: bad status after sanei_w_init_req: %d\n", w->status);
179 + w->version = SANEI_NET_PROTOCOL_VERSION;
181 default_username = strdup (req.username);
183 sanei_w_free (w, (WireCodecFunc) sanei_w_init_req, &req);
186 + DBG (DBG_ERR, "init: bad status after sanei_w_free: %d\n", w->status);
190 reply.version_code = SANE_VERSION_CODE (V_MAJOR, V_MINOR,
191 SANEI_NET_PROTOCOL_VERSION);
193 - status = check_host (w->io.fd);
195 - DBG (DBG_WARN, "init: access by %s@%s %s\n",
196 - default_username, remote_hostname,
197 - (status == SANE_STATUS_GOOD) ? "accepted" : "rejected");
198 + DBG (DBG_WARN, "init: access by %s@%s accepted\n",
199 + default_username, remote_hostname);
201 if (status == SANE_STATUS_GOOD)
204 DBG (DBG_DBG, "process_request: waiting for request\n");
205 sanei_w_set_dir (w, WIRE_DECODE);
206 sanei_w_word (w, &word); /* decode procedure number */
211 + "process_request: bad status %d\n", w->status);
215 current_request = word;
217 DBG (DBG_MSG, "process_request: got request %d\n", current_request);