don't throw around an int for relay_command if we're going to

squeeze it into a uint8_t later. also reported by veracode.


svn:r13607
This commit is contained in:
Roger Dingledine 2008-02-20 00:57:37 +00:00
parent 0977c29196
commit 7427cf5d56
2 changed files with 5 additions and 5 deletions

View File

@ -3511,10 +3511,10 @@ int circuit_receive_relay_cell(cell_t *cell, circuit_t *circ,
void relay_header_pack(char *dest, const relay_header_t *src); void relay_header_pack(char *dest, const relay_header_t *src);
void relay_header_unpack(relay_header_t *dest, const char *src); void relay_header_unpack(relay_header_t *dest, const char *src);
int relay_send_command_from_edge(uint16_t stream_id, circuit_t *circ, int relay_send_command_from_edge(uint16_t stream_id, circuit_t *circ,
int relay_command, const char *payload, uint8_t relay_command, const char *payload,
size_t payload_len, crypt_path_t *cpath_layer); size_t payload_len, crypt_path_t *cpath_layer);
int connection_edge_send_command(edge_connection_t *fromconn, int connection_edge_send_command(edge_connection_t *fromconn,
int relay_command, const char *payload, uint8_t relay_command, const char *payload,
size_t payload_len); size_t payload_len);
int connection_edge_package_raw_inbuf(edge_connection_t *conn, int connection_edge_package_raw_inbuf(edge_connection_t *conn,
int package_partial); int package_partial);

View File

@ -466,7 +466,7 @@ relay_header_unpack(relay_header_t *dest, const char *src)
*/ */
int int
relay_send_command_from_edge(uint16_t stream_id, circuit_t *circ, relay_send_command_from_edge(uint16_t stream_id, circuit_t *circ,
int relay_command, const char *payload, uint8_t relay_command, const char *payload,
size_t payload_len, crypt_path_t *cpath_layer) size_t payload_len, crypt_path_t *cpath_layer)
{ {
cell_t cell; cell_t cell;
@ -526,7 +526,7 @@ relay_send_command_from_edge(uint16_t stream_id, circuit_t *circ,
*/ */
int int
connection_edge_send_command(edge_connection_t *fromconn, connection_edge_send_command(edge_connection_t *fromconn,
int relay_command, const char *payload, uint8_t relay_command, const char *payload,
size_t payload_len) size_t payload_len)
{ {
/* XXXX NM Split this function into a separate versions per circuit type? */ /* XXXX NM Split this function into a separate versions per circuit type? */
@ -1486,7 +1486,7 @@ circuit_consider_sending_sendme(circuit_t *circ, crypt_path_t *layer_hint)
if (relay_send_command_from_edge(0, circ, RELAY_COMMAND_SENDME, if (relay_send_command_from_edge(0, circ, RELAY_COMMAND_SENDME,
NULL, 0, layer_hint) < 0) { NULL, 0, layer_hint) < 0) {
log_warn(LD_CIRC, log_warn(LD_CIRC,
"connection_edge_send_command failed. Circuit's closed."); "relay_send_command_from_edge failed. Circuit's closed.");
return; /* the circuit's closed, don't continue */ return; /* the circuit's closed, don't continue */
} }
} }