Skip to content

Commit

Permalink
fix crash bug in 1ed67b8
Browse files Browse the repository at this point in the history
  • Loading branch information
cofyc committed Nov 28, 2014
1 parent 1ed67b8 commit b020287
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions gen-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ if test -d .git; then

if test "$VC" != "$version"; then
echo "/* Automatically generated by $0 */
#ifndef VERSION_H
#define VERSION_H
#ifndef VERSION_H
#define VERSION_H
const char *the_version = \"$version\";
const char *the_version = \"$version\";
#endif" > $version_file
#endif" > $version_file
fi
fi
7 changes: 4 additions & 3 deletions udp_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ udp_request_kill(UDPRequest *const udp_request)
c = udp_request->context;
if (udp_request->status.is_in_queue != 0) {
assert(!TAILQ_EMPTY(&c->udp_request_queue));
TAILQ_REMOVE(&c->udp_request_queue, udp_request, queue);
assert(c->connections > 0);
c->connections--;
}
Expand All @@ -96,9 +97,9 @@ udp_listener_kill_oldest_request(struct context *c)
{
if (TAILQ_EMPTY(&c->udp_request_queue))
return -1;
UDPRequest *udp_request = TAILQ_FIRST(&c->udp_request_queue);
udp_request_kill(udp_request);
TAILQ_REMOVE(&c->udp_request_queue, udp_request, queue);

udp_request_kill(TAILQ_FIRST(&c->udp_request_queue));

return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
#ifndef VERSION_H
#define VERSION_H

const char *the_version = "0.1.13";
const char *the_version = "0.1.14";

#endif

0 comments on commit b020287

Please sign in to comment.