Changeset 860 for vendor/current/lib
- Timestamp:
- May 12, 2014, 8:58:38 PM (11 years ago)
- Location:
- vendor/current/lib
- Files:
-
- 4 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/lib/addns/dnsgss.c
r740 r860 165 165 struct dns_buffer *buf; 166 166 struct dns_tkey_record *tkey; 167 struct dns_rrec *tkey_answer = NULL; 168 uint16_t i; 167 169 168 170 err = dns_receive(mem_ctx, conn, &buf); … … 175 177 * TODO: Compare id and keyname 176 178 */ 177 178 if ((resp->num_additionals != 1) || 179 (resp->num_answers == 0) || 180 (resp->answers[0]->type != QTYPE_TKEY)) { 179 180 for (i=0; i < resp->num_answers; i++) { 181 if (resp->answers[i]->type != QTYPE_TKEY) { 182 continue; 183 } 184 185 tkey_answer = resp->answers[i]; 186 } 187 188 if (tkey_answer == NULL) { 181 189 err = ERROR_DNS_INVALID_MESSAGE; 182 190 goto error; -
vendor/current/lib/async_req/async_sock.c
r746 r860 636 636 } 637 637 638 if (total + more < total) { 639 tevent_req_error(req, EMSGSIZE); 640 return; 641 } 642 638 643 tmp = talloc_realloc(state, state->buf, uint8_t, total+more); 639 644 if (tevent_req_nomem(tmp, req)) { -
vendor/current/lib/replace/getifaddrs.c
r740 r860 5 5 Copyright (C) Jeremy Allison 2007 6 6 Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007 7 8 This program is free software; you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 3 of the License, or 11 (at your option) any later version. 12 13 This program is distributed in the hope that it will be useful, 7 8 ** NOTE! The following LGPL license applies to the replace 9 ** library. This does NOT imply that all of Samba is released 10 ** under the LGPL 11 12 This library is free software; you can redistribute it and/or 13 modify it under the terms of the GNU Lesser General Public 14 License as published by the Free Software Foundation; either 15 version 3 of the License, or (at your option) any later version. 16 17 This library is distributed in the hope that it will be useful, 14 18 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNUGeneral Public License for more details.17 18 You should have received a copy of the GNU General Public License19 along with this program. If not, see <http://www.gnu.org/licenses/>.19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 Library General Public License for more details. 21 22 You should have received a copy of the GNU Lesser General Public 23 License along with this library; if not, see <http://www.gnu.org/licenses/>. 20 24 */ 21 25 -
vendor/current/lib/replace/libreplace.m4
r740 r860 67 67 68 68 AC_CHECK_HEADERS(stdbool.h stdint.h sys/select.h) 69 AC_CHECK_HEADERS(setjmp.h utime.h )69 AC_CHECK_HEADERS(setjmp.h utime.h sys/wait.h) 70 70 71 71 LIBREPLACE_PROVIDE_HEADER([stdint.h]) … … 106 106 AC_CHECK_HEADERS(stropts.h) 107 107 AC_CHECK_HEADERS(unix.h) 108 AC_CHECK_HEADERS(sys/ucontext.h) 108 109 109 110 AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror strerror_r) … … 267 268 268 269 270 dnl Check if the C compiler understands volatile (it should, being ANSI). 271 AC_CACHE_CHECK([that the C compiler understands volatile],libreplace_cv_volatile, [ 272 AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0], 273 libreplace_cv_volatile=yes,libreplace_cv_volatile=no)]) 274 if test x"$libreplace_cv_volatile" = x"yes"; then 275 AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile]) 276 fi 277 278 m4_include(system/config.m4) 279 269 280 AC_CACHE_CHECK([for O_DIRECT flag to open(2)],libreplace_cv_HAVE_OPEN_O_DIRECT,[ 270 281 AC_TRY_COMPILE([ … … 278 289 AC_DEFINE(HAVE_OPEN_O_DIRECT,1,[Whether the open(2) accepts O_DIRECT]) 279 290 fi 280 281 282 dnl Check if the C compiler understands volatile (it should, being ANSI).283 AC_CACHE_CHECK([that the C compiler understands volatile],libreplace_cv_volatile, [284 AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],285 libreplace_cv_volatile=yes,libreplace_cv_volatile=no)])286 if test x"$libreplace_cv_volatile" = x"yes"; then287 AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile])288 fi289 290 m4_include(system/config.m4)291 291 292 292 m4_include(dlfcn.m4) … … 325 325 if test x"$libreplace_cv_struct_timespec" = x"yes"; then 326 326 AC_DEFINE(HAVE_STRUCT_TIMESPEC,1,[Whether we have struct timespec]) 327 fi 328 329 AC_CACHE_CHECK([for ucontext_t type],libreplace_cv_ucontext_t, [ 330 AC_TRY_COMPILE([ 331 #include <signal.h> 332 #if HAVE_SYS_UCONTEXT_H 333 #include <sys/ucontext.h> 334 # endif 335 ],[ucontext_t uc; sigaddset(&uc.uc_sigmask, SIGUSR1);], 336 libreplace_cv_ucontext_t=yes,libreplace_cv_ucontext_t=no)]) 337 if test x"$libreplace_cv_ucontext_t" = x"yes"; then 338 AC_DEFINE(HAVE_UCONTEXT_T,1,[Whether we have ucontext_t]) 327 339 fi 328 340 -
vendor/current/lib/replace/libreplace_macros.m4
r740 r860 299 299 ]) 300 300 ) 301 AS_IF([ test $AS_TR_SH([ac_cv_c_prototype_$1]) = yes],[$3],[$4])301 AS_IF([eval test $AS_TR_SH([ac_cv_c_prototype_$1]) = yes],[$3],[$4]) 302 302 ]) 303 303 -
vendor/current/lib/replace/replace.c
r740 r860 751 751 #endif 752 752 753 #if ndef HAVE_VDPRINTF753 #if !defined(HAVE_VDPRINTF) || !defined(HAVE_C99_VSNPRINTF) 754 754 int rep_vdprintf(int fd, const char *format, va_list ap) 755 755 { … … 768 768 #endif 769 769 770 #if ndef HAVE_DPRINTF770 #if !defined(HAVE_DPRINTF) || !defined(HAVE_C99_VSNPRINTF) 771 771 int rep_dprintf(int fd, const char *format, ...) 772 772 { -
vendor/current/lib/replace/replace.h
r746 r860 356 356 #endif 357 357 358 #ifndef HAVE_VDPRINTF359 #define vdprintf rep_vdprintf360 int rep_vdprintf(int fd, const char *format, va_list ap);361 #endif362 363 #ifndef HAVE_DPRINTF364 #define dprintf rep_dprintf365 int rep_dprintf(int fd, const char *format, ...);366 #endif367 368 358 #ifndef PRINTF_ATTRIBUTE 369 359 #if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 ) … … 386 376 #endif 387 377 388 #ifndef HAVE_VASPRINTF 378 #if !defined(HAVE_VDPRINTF) || !defined(HAVE_C99_VSNPRINTF) 379 #define vdprintf rep_vdprintf 380 int rep_vdprintf(int fd, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0); 381 #endif 382 383 #if !defined(HAVE_DPRINTF) || !defined(HAVE_C99_VSNPRINTF) 384 #define dprintf rep_dprintf 385 int rep_dprintf(int fd, const char *format, ...) PRINTF_ATTRIBUTE(2,3); 386 #endif 387 388 #if !defined(HAVE_VASPRINTF) || !defined(HAVE_C99_VSNPRINTF) 389 389 #define vasprintf rep_vasprintf 390 390 int rep_vasprintf(char **ptr, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0); … … 401 401 #endif 402 402 403 #if ndef HAVE_ASPRINTF403 #if !defined(HAVE_ASPRINTF) || !defined(HAVE_C99_VSNPRINTF) 404 404 #define asprintf rep_asprintf 405 405 int rep_asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3); 406 #endif 407 408 #if !defined(HAVE_C99_VSNPRINTF) 409 #ifdef REPLACE_BROKEN_PRINTF 410 /* 411 * We do not redefine printf by default 412 * as it breaks the build if system headers 413 * use __attribute__((format(printf, 3, 0))) 414 * instead of __attribute__((format(__printf__, 3, 0))) 415 */ 416 #define printf rep_printf 417 #endif 418 int rep_printf(const char *, ...) PRINTF_ATTRIBUTE(1,2); 419 #endif 420 421 #if !defined(HAVE_C99_VSNPRINTF) 422 #define fprintf rep_fprintf 423 int rep_fprintf(FILE *stream, const char *, ...) PRINTF_ATTRIBUTE(2,3); 406 424 #endif 407 425 -
vendor/current/lib/replace/snprintf.c
r414 r860 1188 1188 } 1189 1189 1190 int vsnprintf (char *str, size_t count, const char *fmt, va_list args)1190 int rep_vsnprintf (char *str, size_t count, const char *fmt, va_list args) 1191 1191 { 1192 1192 return dopr(str, count, fmt, args); … … 1201 1201 */ 1202 1202 #if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_VSNPRINTF) 1203 int snprintf(char *str,size_t count,const char *fmt,...)1203 int rep_snprintf(char *str,size_t count,const char *fmt,...) 1204 1204 { 1205 1205 size_t ret; … … 1214 1214 1215 1215 #ifndef HAVE_C99_VSNPRINTF 1216 int printf(const char *fmt, ...)1216 int rep_printf(const char *fmt, ...) 1217 1217 { 1218 1218 va_list ap; … … 1235 1235 1236 1236 #ifndef HAVE_C99_VSNPRINTF 1237 int fprintf(FILE *stream, const char *fmt, ...)1237 int rep_fprintf(FILE *stream, const char *fmt, ...) 1238 1238 { 1239 1239 va_list ap; … … 1257 1257 #endif 1258 1258 1259 #if ndef HAVE_VASPRINTF1260 int vasprintf(char **ptr, const char *format, va_list ap)1259 #if !defined(HAVE_VASPRINTF) || !defined(HAVE_C99_VSNPRINTF) 1260 int rep_vasprintf(char **ptr, const char *format, va_list ap) 1261 1261 { 1262 1262 int ret; … … 1279 1279 #endif 1280 1280 1281 1282 #ifndef HAVE_ASPRINTF 1283 int asprintf(char **ptr, const char *format, ...) 1281 #if !defined(HAVE_ASPRINTF) || !defined(HAVE_C99_VSNPRINTF) 1282 int rep_asprintf(char **ptr, const char *format, ...) 1284 1283 { 1285 1284 va_list ap; -
vendor/current/lib/replace/socket.c
r414 r860 6 6 * Copyright (C) Michael Adam <obnox@samba.org> 2008 7 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 3 of the License, or 11 * (at your option) any later version. 8 * ** NOTE! The following LGPL license applies to the replace 9 * ** library. This does NOT imply that all of Samba is released 10 * ** under the LGPL 12 11 * 13 * This program is distributed in the hope that it will be useful, 12 * This library is free software; you can redistribute it and/or 13 * modify it under the terms of the GNU Lesser General Public 14 * License as published by the Free Software Foundation; either 15 * version 3 of the License, or (at your option) any later version. 16 * 17 * This library is distributed in the hope that it will be useful, 14 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNUGeneral Public License for more details.19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 * Library General Public License for more details. 17 21 * 18 * You should have received a copy of the GNU General Public License19 * along with this program. If not, see <http://www.gnu.org/licenses/>.22 * You should have received a copy of the GNU Lesser General Public 23 * License along with this library; if not, see <http://www.gnu.org/licenses/>. 20 24 */ 21 25 -
vendor/current/lib/replace/system/wait.h
r740 r860 41 41 #endif 42 42 43 #ifdef HAVE_SYS_UCONTEXT_H 44 #include <sys/ucontext.h> 45 #endif 46 43 47 #if !defined(HAVE_SIG_ATOMIC_T_TYPE) 44 48 typedef int sig_atomic_t; -
vendor/current/lib/replace/test/getifaddrs.c
r414 r860 6 6 * Copyright (C) Michael Adam <obnox@samba.org> 2008 7 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 3 of the License, or 11 * (at your option) any later version. 8 * ** NOTE! The following LGPL license applies to the replace 9 * ** library. This does NOT imply that all of Samba is released 10 * ** under the LGPL 12 11 * 13 * This program is distributed in the hope that it will be useful,14 * but WITHOUT ANY WARRANTY; without even the implied warranty of15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16 * GNU General Public License for more details.12 * This library is free software; you can redistribute it and/or 13 * modify it under the terms of the GNU Lesser General Public 14 * License as published by the Free Software Foundation; either 15 * version 3 of the License, or (at your option) any later version. 17 16 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 * This library is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 * Library General Public License for more details. 21 * 22 * You should have received a copy of the GNU Lesser General Public 23 * License along with this library; if not, see <http://www.gnu.org/licenses/>. 20 24 */ 21 25 -
vendor/current/lib/tevent/tevent_signal.c
r740 r860 123 123 /* we've filled the info array - block this signal until 124 124 these ones are delivered */ 125 #ifdef HAVE_UCONTEXT_T 126 /* 127 * This is the only way for this to work. 128 * By default signum is blocked inside this 129 * signal handler using a temporary mask, 130 * but what we really need to do now is 131 * block it in the callers mask, so it 132 * stays blocked when the temporary signal 133 * handler mask is replaced when we return 134 * from here. The callers mask can be found 135 * in the ucontext_t passed in as the 136 * void *uctx argument. 137 */ 138 ucontext_t *ucp = (ucontext_t *)uctx; 139 sigaddset(&ucp->uc_sigmask, signum); 140 #else 141 /* 142 * WARNING !!! WARNING !!!! 143 * 144 * This code doesn't work. 145 * By default signum is blocked inside this 146 * signal handler, but calling sigprocmask 147 * modifies the temporary signal mask being 148 * used *inside* this handler, which will be 149 * replaced by the callers signal mask once 150 * we return from here. See Samba 151 * bug #9550 for details. 152 */ 125 153 sigset_t set; 126 154 sigemptyset(&set); 127 155 sigaddset(&set, signum); 128 156 sigprocmask(SIG_BLOCK, &set, NULL); 157 #endif 129 158 TEVENT_SIG_INCREMENT(sig_state->sig_blocked[signum]); 130 159 } -
vendor/current/lib/tsocket/tsocket.h
r740 r860 627 627 char *tsocket_address_unix_path(const struct tsocket_address *addr, 628 628 TALLOC_CTX *mem_ctx); 629 630 /** 631 * @brief Request a syscall optimization for tdgram_recvfrom_send() 632 * 633 * This function is only used to reduce the amount of syscalls and 634 * optimize performance. You should only use this if you know 635 * what you're doing. 636 * 637 * The optimization is off by default. 638 * 639 * @param[in] dgram The tdgram_context of a bsd socket, if this 640 * not a bsd socket the function does nothing. 641 * 642 * @param[in] on The boolean value to turn the optimization on and off. 643 * 644 * @return The old boolean value. 645 * 646 * @see tdgram_recvfrom_send() 647 */ 648 bool tdgram_bsd_optimize_recvfrom(struct tdgram_context *dgram, 649 bool on); 629 650 630 651 #ifdef DOXYGEN … … 688 709 _tdgram_unix_socket(local, remote, mem_ctx, dgram, __location__) 689 710 #endif 711 712 /** 713 * @brief Request a syscall optimization for tstream_readv_send() 714 * 715 * This function is only used to reduce the amount of syscalls and 716 * optimize performance. You should only use this if you know 717 * what you're doing. 718 * 719 * The optimization is off by default. 720 * 721 * @param[in] stream The tstream_context of a bsd socket, if this 722 * not a bsd socket the function does nothing. 723 * 724 * @param[in] on The boolean value to turn the optimization on and off. 725 * 726 * @return The old boolean value. 727 * 728 * @see tstream_readv_send() 729 */ 730 bool tstream_bsd_optimize_readv(struct tstream_context *stream, 731 bool on); 690 732 691 733 /** -
vendor/current/lib/tsocket/tsocket_bsd.c
r740 r860 655 655 void *event_ptr; 656 656 struct tevent_fd *fde; 657 bool optimize_recvfrom; 657 658 658 659 void *readable_private; … … 661 662 void (*writeable_handler)(void *private_data); 662 663 }; 664 665 bool tdgram_bsd_optimize_recvfrom(struct tdgram_context *dgram, 666 bool on) 667 { 668 struct tdgram_bsd *bsds = 669 talloc_get_type(_tdgram_context_data(dgram), 670 struct tdgram_bsd); 671 bool old; 672 673 if (bsds == NULL) { 674 /* not a bsd socket */ 675 return false; 676 } 677 678 old = bsds->optimize_recvfrom; 679 bsds->optimize_recvfrom = on; 680 681 return old; 682 } 663 683 664 684 static void tdgram_bsd_fde_handler(struct tevent_context *ev, … … 838 858 } 839 859 860 840 861 /* 841 862 * this is a fast path, not waiting for the … … 843 864 * about 10%-20% performance in benchmark tests. 844 865 */ 845 tdgram_bsd_recvfrom_handler(req); 846 if (!tevent_req_is_in_progress(req)) { 847 goto post; 866 if (bsds->optimize_recvfrom) { 867 /* 868 * We only do the optimization on 869 * recvfrom if the caller asked for it. 870 * 871 * This is needed because in most cases 872 * we preferr to flush send buffers before 873 * receiving incoming requests. 874 */ 875 tdgram_bsd_recvfrom_handler(req); 876 if (!tevent_req_is_in_progress(req)) { 877 goto post; 878 } 848 879 } 849 880 … … 1401 1432 void *event_ptr; 1402 1433 struct tevent_fd *fde; 1434 bool optimize_readv; 1403 1435 1404 1436 void *readable_private; … … 1407 1439 void (*writeable_handler)(void *private_data); 1408 1440 }; 1441 1442 bool tstream_bsd_optimize_readv(struct tstream_context *stream, 1443 bool on) 1444 { 1445 struct tstream_bsd *bsds = 1446 talloc_get_type(_tstream_context_data(stream), 1447 struct tstream_bsd); 1448 bool old; 1449 1450 if (bsds == NULL) { 1451 /* not a bsd socket */ 1452 return false; 1453 } 1454 1455 old = bsds->optimize_readv; 1456 bsds->optimize_readv = on; 1457 1458 return old; 1459 } 1409 1460 1410 1461 static void tstream_bsd_fde_handler(struct tevent_context *ev, … … 1620 1671 * about 10%-20% performance in benchmark tests. 1621 1672 */ 1622 tstream_bsd_readv_handler(req); 1623 if (!tevent_req_is_in_progress(req)) { 1624 goto post; 1673 if (bsds->optimize_readv) { 1674 /* 1675 * We only do the optimization on 1676 * readv if the caller asked for it. 1677 * 1678 * This is needed because in most cases 1679 * we preferr to flush send buffers before 1680 * receiving incoming requests. 1681 */ 1682 tstream_bsd_readv_handler(req); 1683 if (!tevent_req_is_in_progress(req)) { 1684 goto post; 1685 } 1625 1686 } 1626 1687 -
vendor/current/lib/tsocket/tsocket_helpers.c
r478 r860 213 213 size_t i; 214 214 struct tevent_req *subreq; 215 bool optimize = false; 216 bool save_optimize = false; 217 218 if (state->count > 0) { 219 /* 220 * This is not the first time we asked for a vector, 221 * which means parts of the pdu already arrived. 222 * 223 * In this case it make sense to enable 224 * a syscall/performance optimization if the 225 * low level tstream implementation supports it. 226 */ 227 optimize = true; 228 } 215 229 216 230 TALLOC_FREE(state->vector); … … 256 270 } 257 271 272 if (optimize) { 273 /* 274 * If the low level stream is a bsd socket 275 * we will get syscall optimization. 276 * 277 * If it is not a bsd socket 278 * tstream_bsd_optimize_readv() just returns. 279 */ 280 save_optimize = tstream_bsd_optimize_readv(state->caller.stream, 281 true); 282 } 258 283 subreq = tstream_readv_send(state, 259 284 state->caller.ev, … … 261 286 state->vector, 262 287 state->count); 288 if (optimize) { 289 tstream_bsd_optimize_readv(state->caller.stream, 290 save_optimize); 291 } 263 292 if (tevent_req_nomem(subreq, req)) { 264 293 return; -
vendor/current/lib/util/debug.c
r746 r860 954 954 sizeof(header_str) -1 - hs_len, 955 955 ", class=%s", 956 default_classname_table[cls]);956 classname_table[cls]); 957 957 } 958 958
Note:
See TracChangeset
for help on using the changeset viewer.