summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-08-15 14:25:36 -0400
committerirungentoo <irungentoo@gmail.com>2013-08-15 14:25:36 -0400
commit2663b9d23dc9c1f0aeb28ed387278229b9f2383f (patch)
treeca4ed0e2c6cab74f27d7af0e9c1991414ced7444
parent575804d19f4e99f544e12330121eebbcc6b6ebfd (diff)
parentbf0c2364e188270a24ccbee32c4a0c52cd28dc73 (diff)
Merge branch 'master' of https://github.com/irungentoo/ProjectTox-Core
-rw-r--r--INSTALL.md10
-rw-r--r--core/Messenger.c11
-rw-r--r--core/Messenger.h1
-rw-r--r--other/DHTservers3
4 files changed, 16 insertions, 9 deletions
diff --git a/INSTALL.md b/INSTALL.md
index 1ee1c66f..3d01d562 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -23,7 +23,7 @@ On Fedora:
23 23
24```bash 24```bash
25yum groupinstall "Development Tools" 25yum groupinstall "Development Tools"
26yum install libtool autoconf automake libconfig-devel ncurses-devel cmake check 26yum install libtool autoconf automake libconfig-devel ncurses-devel cmake check check-devel
27``` 27```
28 28
29Note that `libconfig-dev` should be >= 1.4. 29Note that `libconfig-dev` should be >= 1.4.
@@ -61,8 +61,8 @@ mkdir build && cd build
61cmake .. 61cmake ..
62``` 62```
63Advance cmake options: 63Advance cmake options:
64 - `-DSHARED_TOXCORE=ON` (default `OFF`) Build Core as a shared library. 64 - `-DSHARED_TOXCORE=ON` (default `OFF`) � Build Core as a shared library.
65 - `-DUSE_NACL=ON` (default `OFF`) Use NaCl library instead of libsodium. 65 - `-DUSE_NACL=ON` (default `OFF`) � Use NaCl library instead of libsodium.
66 66
67Note that you should call cmake on the root [`CMakeLists.txt`](/CMakeLists.txt) file only. 67Note that you should call cmake on the root [`CMakeLists.txt`](/CMakeLists.txt) file only.
68 68
@@ -150,8 +150,8 @@ mkdir build && cd build
150cmake -G "MinGW Makefiles" .. 150cmake -G "MinGW Makefiles" ..
151``` 151```
152Advance cmake options: 152Advance cmake options:
153 - `-DSHARED_TOXCORE=ON` (default OFF) Build Core as a shared library. 153 - `-DSHARED_TOXCORE=ON` (default OFF) � Build Core as a shared library.
154 - `-DSHARED_LIBSODIUM=ON` (default OFF) Link libsodium as a shared library. 154 - `-DSHARED_LIBSODIUM=ON` (default OFF) � Link libsodium as a shared library.
155 155
156Note that you should call cmake on the root [`CMakeLists.txt`](/CMakeLists.txt) file only. 156Note that you should call cmake on the root [`CMakeLists.txt`](/CMakeLists.txt) file only.
157 157
diff --git a/core/Messenger.c b/core/Messenger.c
index 690a81b1..bed59d4d 100644
--- a/core/Messenger.c
+++ b/core/Messenger.c
@@ -120,6 +120,7 @@ void getaddress(Messenger *m, uint8_t *address)
120 * return FAERR_BADCHECKSUM if bad checksum in address 120 * return FAERR_BADCHECKSUM if bad checksum in address
121 * return FAERR_SETNEWNOSPAM if the friend was already there but the nospam was different 121 * return FAERR_SETNEWNOSPAM if the friend was already there but the nospam was different
122 * (the nospam for that friend was set to the new one) 122 * (the nospam for that friend was set to the new one)
123 * return FAERR_NOMEM if increasing the friend list size fails
123 */ 124 */
124int m_addfriend(Messenger *m, uint8_t *address, uint8_t *data, uint16_t length) 125int m_addfriend(Messenger *m, uint8_t *address, uint8_t *data, uint16_t length)
125{ 126{
@@ -148,7 +149,8 @@ int m_addfriend(Messenger *m, uint8_t *address, uint8_t *data, uint16_t length)
148 } 149 }
149 150
150 /* resize the friend list if necessary */ 151 /* resize the friend list if necessary */
151 realloc_friendlist(m, m->numfriends + 1); 152 if (realloc_friendlist(m, m->numfriends + 1) != 0)
153 return FAERR_NOMEM;
152 154
153 uint32_t i; 155 uint32_t i;
154 for (i = 0; i <= m->numfriends; ++i) { 156 for (i = 0; i <= m->numfriends; ++i) {
@@ -180,7 +182,8 @@ int m_addfriend_norequest(Messenger *m, uint8_t * client_id)
180 return -1; 182 return -1;
181 183
182 /* resize the friend list if necessary */ 184 /* resize the friend list if necessary */
183 realloc_friendlist(m, m->numfriends + 1); 185 if (realloc_friendlist(m, m->numfriends + 1) != 0)
186 return FAERR_NOMEM;
184 187
185 uint32_t i; 188 uint32_t i;
186 for (i = 0; i <= m->numfriends; ++i) { 189 for (i = 0; i <= m->numfriends; ++i) {
@@ -221,7 +224,9 @@ int m_delfriend(Messenger *m, int friendnumber)
221 break; 224 break;
222 } 225 }
223 m->numfriends = i; 226 m->numfriends = i;
224 realloc_friendlist(m, m->numfriends + 1); 227
228 if (realloc_friendlist(m, m->numfriends + 1) != 0)
229 return FAERR_NOMEM;
225 230
226 return 0; 231 return 0;
227} 232}
diff --git a/core/Messenger.h b/core/Messenger.h
index a2add19d..a7e0aab5 100644
--- a/core/Messenger.h
+++ b/core/Messenger.h
@@ -63,6 +63,7 @@ extern "C" {
63#define FAERR_UNKNOWN -5 63#define FAERR_UNKNOWN -5
64#define FAERR_BADCHECKSUM -6 64#define FAERR_BADCHECKSUM -6
65#define FAERR_SETNEWNOSPAM -7 65#define FAERR_SETNEWNOSPAM -7
66#define FAERR_NOMEM -8
66 67
67/* don't assume MAX_STATUSMESSAGE_LENGTH will stay at 128, it may be increased 68/* don't assume MAX_STATUSMESSAGE_LENGTH will stay at 128, it may be increased
68 to an absurdly large number later */ 69 to an absurdly large number later */
diff --git a/other/DHTservers b/other/DHTservers
index 560c29b5..6efba882 100644
--- a/other/DHTservers
+++ b/other/DHTservers
@@ -3,4 +3,5 @@
3192.184.81.118 33445 5CD7EB176C19A2FD840406CD56177BB8E75587BB366F7BB3004B19E3EDC04143 3192.184.81.118 33445 5CD7EB176C19A2FD840406CD56177BB8E75587BB366F7BB3004B19E3EDC04143
4192.210.149.121 33445 F404ABAA1C99A9D37D61AB54898F56793E1DEF8BD46B1038B9D822E8460FAB67 4192.210.149.121 33445 F404ABAA1C99A9D37D61AB54898F56793E1DEF8BD46B1038B9D822E8460FAB67
581.224.34.47 443 48F0D94C0D54EB1995A2ECEDE7DB6BDD5E05D81704B2F3D1BB9FE43AC97B7269 581.224.34.47 443 48F0D94C0D54EB1995A2ECEDE7DB6BDD5E05D81704B2F3D1BB9FE43AC97B7269
6198.46.136.167 33445 728925473812C7AAC482BE7250BCCAD0B8CB9F737BF3D42ABD34459C1768F854 \ No newline at end of file 6198.46.136.167 33445 728925473812C7AAC482BE7250BCCAD0B8CB9F737BF3D42ABD34459C1768F854
795.47.140.214 33445 F4BF7C5A9D0EF4CB684090C38DE937FAE1612021F21FEA4DCBFAC6AAFEF58E68