projects
/
cascardo
/
f2fchat.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Set state as online if PING is received.
[cascardo/f2fchat.git]
/
friend.c
diff --git
a/friend.c
b/friend.c
index
03d306d
..
2e50f36
100644
(file)
--- a/
friend.c
+++ b/
friend.c
@@
-81,6
+81,7
@@
void friend_timeout(struct friend *friend)
void friend_got_message(struct friend *friend, char *buffer, size_t len)
{
if (len >= 4 && !strncmp(buffer, "PING", 4)) {
void friend_got_message(struct friend *friend, char *buffer, size_t len)
{
if (len >= 4 && !strncmp(buffer, "PING", 4)) {
+ friend->state = STATE_ONLINE;
pong(friend);
} else if (len >= 4 && !strncmp(buffer, "PONG", 4)) {
friend->state = STATE_ONLINE;
pong(friend);
} else if (len >= 4 && !strncmp(buffer, "PONG", 4)) {
friend->state = STATE_ONLINE;