curl.c (0d1460226fb05c92fa3ad869ca39090ff13cf6bc) curl.c (f2e5dca46b5ba4588c0756c5f272123585cbbf23)
1/*
2 * QEMU Block driver for CURL images
3 *
4 * Copyright (c) 2009 Alexander Graf <agraf@suse.de>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 79 unchanged lines hidden (view full) ---

88static void curl_multi_do(void *arg);
89
90static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action,
91 void *s, void *sp)
92{
93 DPRINTF("CURL (AIO): Sock action %d on fd %d\n", action, fd);
94 switch (action) {
95 case CURL_POLL_IN:
1/*
2 * QEMU Block driver for CURL images
3 *
4 * Copyright (c) 2009 Alexander Graf <agraf@suse.de>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 79 unchanged lines hidden (view full) ---

88static void curl_multi_do(void *arg);
89
90static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action,
91 void *s, void *sp)
92{
93 DPRINTF("CURL (AIO): Sock action %d on fd %d\n", action, fd);
94 switch (action) {
95 case CURL_POLL_IN:
96 qemu_aio_set_fd_handler(fd, curl_multi_do, NULL, NULL, s);
96 qemu_aio_set_fd_handler(fd, curl_multi_do, NULL, s);
97 break;
98 case CURL_POLL_OUT:
97 break;
98 case CURL_POLL_OUT:
99 qemu_aio_set_fd_handler(fd, NULL, curl_multi_do, NULL, s);
99 qemu_aio_set_fd_handler(fd, NULL, curl_multi_do, s);
100 break;
101 case CURL_POLL_INOUT:
100 break;
101 case CURL_POLL_INOUT:
102 qemu_aio_set_fd_handler(fd, curl_multi_do, curl_multi_do,
103 NULL, s);
102 qemu_aio_set_fd_handler(fd, curl_multi_do, curl_multi_do, s);
104 break;
105 case CURL_POLL_REMOVE:
103 break;
104 case CURL_POLL_REMOVE:
106 qemu_aio_set_fd_handler(fd, NULL, NULL, NULL, NULL);
105 qemu_aio_set_fd_handler(fd, NULL, NULL, NULL);
107 break;
108 }
109
110 return 0;
111}
112
113static size_t curl_header_cb(void *ptr, size_t size, size_t nmemb, void *opaque)
114{

--- 575 unchanged lines hidden ---
106 break;
107 }
108
109 return 0;
110}
111
112static size_t curl_header_cb(void *ptr, size_t size, size_t nmemb, void *opaque)
113{

--- 575 unchanged lines hidden ---