Skip to content

Commit

Permalink
Another function down gooo copy and paste!
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikhil Samith Bysani committed Jan 18, 2009
1 parent 25a9657 commit 2fbc03d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/base/bang-routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,21 @@ static sqlite3_stmt* prepare_select_statement(uuid_t uuid) {

void BANG_route_job(uuid_t uuid, BANG_job *job) {
sqlite3_stmt *get_peer_route = prepare_select_statement(uuid);
sqlite3_bind_blob(get_peer_route,1,peer,sizeof(uuid_t),SQLITE_STATIC);
sqlite3_bind_blob(get_peer_route,1,uuid,sizeof(uuid_t),SQLITE_STATIC);

if (sqlite3_step(get_peer_route) == SQLITE_ROW) {
if (sqlite3_column_int(get_peer_route,1) == REMOTE_ROUTE) {
/* TODO: Make a request to peer. */
} else {
const BANG_module *module = sqlite3_column_blob(get_peer_route,2);
/* TODO: Callback peer with job */
}
}
}

void BANG_route_finished_job(uuid_t uuid, BANG_job *job) {
sqlite3_stmt *get_peer_route = prepare_select_statement(uuid);
sqlite3_bind_blob(get_peer_route,1,uuid,sizeof(uuid_t),SQLITE_STATIC);

if (sqlite3_step(get_peer_route) == SQLITE_ROW) {
if (sqlite3_column_int(get_peer_route,1) == REMOTE_ROUTE) {
Expand Down

0 comments on commit 2fbc03d

Please sign in to comment.