Copy of NetServicesMin with the HTTP Client library. Includes modification for HTTP servers which send the HTTP status line in its own packet.
lwip/core/sys.c@0:18dd877d2c77, 2011-05-26 (annotated)
- Committer:
- andrewbonney
- Date:
- Thu May 26 10:02:40 2011 +0000
- Revision:
- 0:18dd877d2c77
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andrewbonney | 0:18dd877d2c77 | 1 | /** |
andrewbonney | 0:18dd877d2c77 | 2 | * @file |
andrewbonney | 0:18dd877d2c77 | 3 | * lwIP Operating System abstraction |
andrewbonney | 0:18dd877d2c77 | 4 | * |
andrewbonney | 0:18dd877d2c77 | 5 | */ |
andrewbonney | 0:18dd877d2c77 | 6 | |
andrewbonney | 0:18dd877d2c77 | 7 | /* |
andrewbonney | 0:18dd877d2c77 | 8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. |
andrewbonney | 0:18dd877d2c77 | 9 | * All rights reserved. |
andrewbonney | 0:18dd877d2c77 | 10 | * |
andrewbonney | 0:18dd877d2c77 | 11 | * Redistribution and use in source and binary forms, with or without modification, |
andrewbonney | 0:18dd877d2c77 | 12 | * are permitted provided that the following conditions are met: |
andrewbonney | 0:18dd877d2c77 | 13 | * |
andrewbonney | 0:18dd877d2c77 | 14 | * 1. Redistributions of source code must retain the above copyright notice, |
andrewbonney | 0:18dd877d2c77 | 15 | * this list of conditions and the following disclaimer. |
andrewbonney | 0:18dd877d2c77 | 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
andrewbonney | 0:18dd877d2c77 | 17 | * this list of conditions and the following disclaimer in the documentation |
andrewbonney | 0:18dd877d2c77 | 18 | * and/or other materials provided with the distribution. |
andrewbonney | 0:18dd877d2c77 | 19 | * 3. The name of the author may not be used to endorse or promote products |
andrewbonney | 0:18dd877d2c77 | 20 | * derived from this software without specific prior written permission. |
andrewbonney | 0:18dd877d2c77 | 21 | * |
andrewbonney | 0:18dd877d2c77 | 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
andrewbonney | 0:18dd877d2c77 | 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
andrewbonney | 0:18dd877d2c77 | 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT |
andrewbonney | 0:18dd877d2c77 | 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
andrewbonney | 0:18dd877d2c77 | 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT |
andrewbonney | 0:18dd877d2c77 | 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
andrewbonney | 0:18dd877d2c77 | 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
andrewbonney | 0:18dd877d2c77 | 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
andrewbonney | 0:18dd877d2c77 | 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY |
andrewbonney | 0:18dd877d2c77 | 31 | * OF SUCH DAMAGE. |
andrewbonney | 0:18dd877d2c77 | 32 | * |
andrewbonney | 0:18dd877d2c77 | 33 | * This file is part of the lwIP TCP/IP stack. |
andrewbonney | 0:18dd877d2c77 | 34 | * |
andrewbonney | 0:18dd877d2c77 | 35 | * Author: Adam Dunkels <adam@sics.se> |
andrewbonney | 0:18dd877d2c77 | 36 | * |
andrewbonney | 0:18dd877d2c77 | 37 | */ |
andrewbonney | 0:18dd877d2c77 | 38 | |
andrewbonney | 0:18dd877d2c77 | 39 | #include "lwip/opt.h" |
andrewbonney | 0:18dd877d2c77 | 40 | |
andrewbonney | 0:18dd877d2c77 | 41 | #include "lwip/sys.h" |
andrewbonney | 0:18dd877d2c77 | 42 | |
andrewbonney | 0:18dd877d2c77 | 43 | /* Most of the functions defined in sys.h must be implemented in the |
andrewbonney | 0:18dd877d2c77 | 44 | * architecture-dependent file sys_arch.c */ |
andrewbonney | 0:18dd877d2c77 | 45 | |
andrewbonney | 0:18dd877d2c77 | 46 | #if !NO_SYS |
andrewbonney | 0:18dd877d2c77 | 47 | |
andrewbonney | 0:18dd877d2c77 | 48 | /** |
andrewbonney | 0:18dd877d2c77 | 49 | * Sleep for some ms. Timeouts are NOT processed while sleeping. |
andrewbonney | 0:18dd877d2c77 | 50 | * |
andrewbonney | 0:18dd877d2c77 | 51 | * @param ms number of milliseconds to sleep |
andrewbonney | 0:18dd877d2c77 | 52 | */ |
andrewbonney | 0:18dd877d2c77 | 53 | void |
andrewbonney | 0:18dd877d2c77 | 54 | sys_msleep(u32_t ms) |
andrewbonney | 0:18dd877d2c77 | 55 | { |
andrewbonney | 0:18dd877d2c77 | 56 | if (ms > 0) { |
andrewbonney | 0:18dd877d2c77 | 57 | sys_sem_t delaysem; |
andrewbonney | 0:18dd877d2c77 | 58 | err_t err = sys_sem_new(&delaysem, 0); |
andrewbonney | 0:18dd877d2c77 | 59 | if (err == ERR_OK) { |
andrewbonney | 0:18dd877d2c77 | 60 | sys_arch_sem_wait(&delaysem, ms); |
andrewbonney | 0:18dd877d2c77 | 61 | sys_sem_free(&delaysem); |
andrewbonney | 0:18dd877d2c77 | 62 | } |
andrewbonney | 0:18dd877d2c77 | 63 | } |
andrewbonney | 0:18dd877d2c77 | 64 | } |
andrewbonney | 0:18dd877d2c77 | 65 | |
andrewbonney | 0:18dd877d2c77 | 66 | #endif /* !NO_SYS */ |